<?php

class IndexController extends Site_Controller_Action
{
    public function init()
    {
        
    }

    public function indexAction()
    {
        
        $pagina = $this->_getParam('pagina', '');
        $this->view->pagina = $pagina;
        
        $result = $this->db->fetchRow('SELECT SQL_CACHE * FROM ST_PAGINA WHERE PGS_PAGEST like "empresa" AND PGS_STA = 1 ');
        $this->view->empresa_home = $result; 
        
        $result = $this->db->fetchAll('SELECT SQL_CACHE b.*,c.CTS_NOM FROM ST_SERVICO b, ST_CATEGORIA_SERVICO c WHERE b.CTS_ID = c.CTS_ID AND SER_STA = 1 ORDER BY SER_NOM ASC');
        $this->view->servicos = $result;  
        
        $result = $this->db->fetchRow('SELECT SQL_CACHE b.*,c.CTS_NOM FROM ST_SERVICO b, ST_CATEGORIA_SERVICO c WHERE b.CTS_ID = c.CTS_ID AND SER_STA = 1 AND SER_STADTQ = 1 ORDER BY RAND() LIMIT 0,1');
        $this->view->servico_destaque = $result; 
        
        $result = $this->db->fetchAll('SELECT SQL_CACHE * FROM ST_PORTFOLIO WHERE POR_STA = 1 ORDER BY POR_DAT DESC LIMIT 3');
        $this->view->portfolio = $result;
        
        $result = $this->db->fetchAll('SELECT SQL_CACHE * FROM ST_BLOG WHERE BLO_STA = 1 ORDER BY BLO_DAT DESC LIMIT 3');
        $this->view->blog = $result;
        
    }
    
}

